![]() |
PBSetEOFAsync |
||||
Header: | Files.h | Carbon status: | Supported | |
Sets the logical end-of-file of an open file.
OSErr PBSetEOFAsync ( ParmBlkPtr paramBlock );
A pointer to a basic File Manager parameter block.
A result code.
The relevant fields of the parameter block are:
On input, a pointer to a completion routine.
On output, the result code of the function.
On input, a file reference number for the file whose logical end you wish to set.
On input, the logical end-of-file. Because the ioMisc field is of type Ptr, you must coerce the desired value from type LongInt to type Ptr.
If you attempt to set the logical end-of-file beyond the current physical end-of-file, another allocation block is added to the file; if there isn’t enough space on the volume, no change is made and PBSetEOFAsync returns dskFulErr as its function result.
If the value of the ioMisc field is 0, all space occupied by the file on the volume is released. The file still exists, but it contains 0 bytes. Setting a file fork’s end-of-file to 0 is therefore not the same as deleting the file (which removes both file forks at once).
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)